package com.aabbc.trading.controller;

import com.aabbc.order.entity.OrderInfo;
import com.aabbc.order.facade.IOrderInfoFacade;
import com.aabbc.user.entity.UserInfo;
import com.aabbc.user.facade.IUserInfoFacade;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * TradingController
 *
 * @author: <a href="mailto:chenfenghai@oristartech.com">chenfenghai</a>
 * @version: 1.0
 * @date: 2019-11-04 14:27
 */
@RestController
@RequestMapping("/trading")
public class TradingController {

    @Reference(version = "1.0.0")
    IUserInfoFacade userInfoFacade;

    @Reference(version = "1.0.0")
    IOrderInfoFacade orderInfoFacade;

    @GetMapping("/test")
    public String test(){
        return "TradingController.test" + System.currentTimeMillis();
    }

    @GetMapping("/userList")
    public List<UserInfo> queryUserInfoList(){
        return userInfoFacade.queryUserInfoList();
    }

    @GetMapping("/orderList")
    public List<OrderInfo> queryOrderInfoList(){
        return orderInfoFacade.queryOrderInfoList();
    }

}
